package com.hackintosh.state.student;

/**
 * @description：
 * @author：twislyn
 * @date：Created in 2021/05/23
 * @modified By：
 * @version: 1.0
 */
public abstract class AbstractState {
    protected String stateName;

    protected ScoreContext scoreContext;

    protected int score;

    public abstract void checkState();

    public void addScore(int score) {
        this.score += score;
        System.out.print(String.format("加上：%d 分，\t当前分数：%d", score, this.score));
        checkState();
        System.out.println(String.format("分，\t当前状态：%s", this.scoreContext.getState().stateName));
    }
}
